<!--
 * @Author: gy
 * @Date: 2020-07-02 10:26:18
 * @LastEditors  : gy
 * @LastEditTime : 2020-07-12 18:14:37
-->
<!-- pro_equipment_code	是	string	设备编号
pro_equipment_name	是	string	设备名称
pro_equipment_desc	是	string	设备描述
pro_equipment_num	是	string	项目名称
station_material_no	是	string	主件品号
fk_pro_sta_id	是	string	项目名称
status	是	string	状态(0 正常 1 禁用)
remark	否	string	备注 -->
<!--  -->
<template>
    <div>
        <el-form ref="form" :model="form" :rules="rules">
            <el-form-item label="设备编号" prop="pro_equipment_code">
                <el-input v-model="form.pro_equipment_code"></el-input>
            </el-form-item>
            <el-form-item label="设备名称" prop="pro_equipment_name">
                <el-input v-model="form.pro_equipment_name"></el-input>
            </el-form-item>
            <el-form-item label="设备描述" prop="pro_equipment_desc">
                <el-input v-model="form.pro_equipment_desc"></el-input>
            </el-form-item>
            <el-form-item label="待生产设备数" prop="pro_equipment_num">
                <el-input v-model.number="form.pro_equipment_num"></el-input>
            </el-form-item>
            <el-form-item label="主件品号" prop="station_material_no">
                <el-input v-model="form.station_material_no"></el-input>
            </el-form-item>
            <el-form-item label="工位外键" prop="fk_pro_sta_id">
                <el-select v-model="form.fk_pro_sta_id" placeholder="">
                    <el-option
                        v-for="item in stationList"
                        :key="item.pk_id"
                        :label="item.station_name"
                        :value="item.pk_id"
                    ></el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="状态">
                <el-switch
                    v-model="form.status"
                    active-value="0"
                    inactive-value="1"
                    active-text="正常"
                    inactive-text="禁用"
                ></el-switch>
            </el-form-item>
            <el-form-item label="备注">
                <el-input type="textarea" v-model="form.remark"></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
import { GetMesStationList } from "@/api/api";
export default {
    props: {},
    data() {
        return {
            stationList: [],
            form: {
                pro_equipment_code: "",
                pro_equipment_name: "",
                pro_equipment_desc: "",
                pro_equipment_num: "",
                station_material_no: "",
                fk_pro_sta_id: ""
            },
            rules: {
                pro_equipment_code: [
                    {
                        required: true,
                        message: "请输入设备编号",
                        trigger: "blur"
                    }
                ],
                pro_equipment_name: [
                    {
                        required: true,
                        message: "请输入设备名称",
                        trigger: "blur"
                    }
                ],
                pro_equipment_desc: [
                    {
                        required: true,
                        message: "请输入设备描述",
                        trigger: "blur"
                    }
                ],
                pro_equipment_num: [
                    {
                        required: true,
                        message: "请输入待生产设备数",
                        trigger: "blur"
                    }
                ],
                station_material_no: [
                    {
                        required: true,
                        message: "请输入主件品号",
                        trigger: "blur"
                    }
                ],
                fk_pro_sta_id: [
                    {
                        required: true,
                        message: "请输入项目名称",
                        trigger: "blur"
                    }
                ]
            },
            checkRepeatParam: {
                url:
                    "/material/api/MesProEquipment/CheckMesProEquipmentCodeUnique",
                param: "pro_equipment_code",
                method: "get"
            }
        };
    },
    created() {
        GetMesStationList().then(res => {
            this.stationList = res.rows;
        });
    },
    components: {},

    methods: {}
};
</script>
<style lang="scss" scoped></style>
